<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="敛书网 - 图书详情">
    <meta name="keywords" content="图书详情, 敛书网, 电子书">
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/bootstrap.min.css">
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/bookDetail.css">
    <title>敛书网 - 图书详情</title>
</head>
<body>

<%@include file="common/loginHead.jsp"%>
<%@include file="common/userHead.jsp"%>

<div id="bookDetail" class="container mt-4">

    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-danger">
                <div class="panel-heading">
                    <span class="text-primary">图书详情</span>
                </div>
                <div class="panel-body">

                    <div class="book-cover col-md-4">
                        <img src="getBookCover?coverPath=${book.book_cover}" alt="${book.book_title}" class="img-responsive">
                    </div>

                    <div class="book-labels col-md-5">
                        <p>
                            <strong>图书名称：</strong>
                            <span>${book.book_title}</span>
                        </p>
                        <p>
                            <strong>作者：</strong>
                            <span>${book.book_author}</span>
                        </p>
                        <p>
                            <strong>出版时间：</strong>
                            <span><fmt:formatDate value="${book.book_pubYear}" pattern="yyyy-MM"/></span>
                        </p>
                        <p>
                            <strong>上传者：</strong>
                            <span>${uploader}</span>
                        </p>
                        <p>
                            <strong>上传时间：</strong>
                            <span>${uploadedDate}</span>
                        </p>
                        <p>
                            <strong>下载：</strong>
                            <a href="book_download?bookID=${book.id}&filePath=${book.book_file}" class="btn btn-sm btn-info">
                                ${format}&nbsp;<i class="glyphicon glyphicon-download-alt"></i>
                            </a>
                        </p>
                        <p>
                            <strong>在线阅读：</strong>
                            <a href="readBook?bookID=${book.id}" class="btn btn-sm btn-success">
                                阅读&nbsp;<i class="glyphicon glyphicon-eye-open"></i>
                            </a>
                        </p>
                        <p>
                            <strong>简介：</strong>
                            <span>${book.book_summary}</span>
                        </p>
                    </div>

                    <div class="col-md-3">
                        <div class="alert alert-warning" role="alert">
                            <p>本站提供的所有资源仅供学习和研究使用，请勿用于商业用途。谢谢合作。</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>

<hr>

<footer class="text-center">
    <p>&copy; 2021 收敛书网</p>
</footer>

<script src="${pageContext.request.contextPath}/resources/js/jquery-3.1.1.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.cookie.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/userLogin.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/userRegister.js"></script>

</body>
</html>
